import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.bouncycastle.util.encoders.Hex;


public class TT {
    public static void main(String[] args) {
        ByteBuf byteBuf = Unpooled.buffer(10);
        byteBuf.writeBytes(new byte[]{0x01, 0x02, 0x03, 0x04, 0x05});

        int index = 2;
        byte[] dst = new byte[byteBuf.readableBytes() - index];
        byteBuf.getBytes(index, dst);
        System.out.println(Hex.toHexString(dst));
        byteBuf.writeByte(0x06);
        System.out.println("byteBuf readableBytes:"+byteBuf.readableBytes());


        System.out.println(String.format("0x%02X", 1));
    }
}
